package com.cn.wanxi.service.impl;

import com.cn.wanxi.dao.CompanyDao;
import com.cn.wanxi.dao.impl.CompanyImpl;
import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.model.ResultModel;
import com.cn.wanxi.service.CompanyService;
import redis.clients.jedis.Jedis;

public class CompanyServiceImpl implements CompanyService {
    private CompanyDao companyDao = new CompanyImpl();

    @Override
    public ResultModel add(CompanyModel companyModel) {

        return null;
    }

    @Override
    public ResultModel update(CompanyModel companyModel) {
//        当用户更新成功以后，需要删除redis里面的数据
        int count = companyDao.update(companyModel);
        if (count > 0) {
            Jedis jedis = new Jedis();
            jedis.del("logo");
        }
        return ResultModel.getResult(count);
    }

    @Override
    public ResultModel delete(CompanyModel companyModel) {
        return null;
    }

    @Override
    public ResultModel findById(CompanyModel companyModel) {
        return null;
    }

    @Override
    public ResultModel findAll(CompanyModel companyModel) {
        return null;
    }

    @Override
    public ResultModel getCount(CompanyModel companyModel) {
        return null;
    }
}
